package org.springblade.modules.admin.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.admin.entity.BusinessApprove;
import org.springblade.modules.admin.entity.MaintainPlanContentUser;
import org.springblade.modules.admin.enums.EmerProcTypeEnum;
import org.springblade.modules.admin.enums.WorkOrderTypeEnum;

import java.util.Date;
import java.util.List;

/**
 * @Date 9:36 2021/10/18
 * @Description {
 *    维修详情
 * }
 * @Author lsay
 **/
@Data
public class MalFunctionDetailVO {

	/**
	 * 任务 id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long planId;

	/**
	 * 审批 id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long businessApproveId;

	/**
	 * 任务状态
	 */
	private Integer status;

	/**
	 * 任务状态
	 */
	private Long planFinishDate;

	/**
	 * 电梯id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long elevatorId;

	/**
	 * 电梯状态： 1-正常,2-停梯
	 */
	private Integer elevatorStop;

	/**
	 * 故障信息
	 */
	private List<FaultMessageVO> faultMessageList;

	/**
	 * 报障信息
	 */
	private FaultReportVO faultReportVO;

	/**
	 * 故障原因
	 */
	private FaultReasonVO faultReasonVO;

	/**
	 * 维修详情最后一次任务
	 */
	private LastPlanVO lastPlan;

	/**
	 * 维修操作记录
	 */
	private List<MalFunctionHistoryVO> malFunctionHistories;

	/**
	 * 关联任务的用户
	 */
	private List<MaintainPlanContentUser> planContentUsers;


	@ApiModelProperty("审批信息")
	private BusinessApprove businessApprove;

	@ApiModelProperty("电梯唯一识别码")
	private String elevatorNum;

	@ApiModelProperty("building id")
	private Long buildingId;

	/**
	 * 紧急程度
	 */
	private Integer emerProcType;

	/**
	 * 工单类型
	 */
	private Integer workOrderType;

	/**
	 * 紧急程度描述
	 */
	private String emerProcTypeName;

	/**
	 * 工单类型描述
	 */
	private String workOrderTypeName;

	/**
	 * 2024-06-03 新增返回工单类型名称
	 */
	private String planTypeName;

	public void setEmerProcType(Integer emerProcType) {
		if(Func.isNotEmpty(emerProcType)){
			this.emerProcTypeName = EmerProcTypeEnum.getName(emerProcType);
		}
		this.emerProcType = emerProcType;
	}

	public void setWorkOrderType(Integer workOrderType) {
		if(Func.isNotEmpty(workOrderType)){
			this.workOrderTypeName = WorkOrderTypeEnum.getName(workOrderType);
		}
		this.workOrderType = workOrderType;
	}

}




























